Next | Prev | Up | Top | Contents | Index

Device Files

IRIX programs communicate with hardware devices through two types of files, called special files. The two types are character device files (also called raw device files) and block device files.

Device files are in the /dev directory of the Root filesystem. Since every entry in a directory is a file (see Table 3-2), conceptually a disk device is treated as if it were a file. In practice, there are differences between regular files and device files, so the latter are referred to as special files.

Device files are created automatically when system software is installed and, if necessary, at system boot up by the command MAKEDEV. The device files created by MAKEDEV are based on the hardware configuration of the system; however, not all possible device files are created. Disk device files are created only for partitions 0, 1, 6, 7, 15, vh, and vol (vh stands for volume header and is partition 8, vol is the entire volume and is the same as partition 10). You can run MAKEDEV manually if you added a supported device, or, to create a specific device file, you can use the mknod command. For more information about MAKEDEV, see the section "Creating Device Files With MAKEDEV" in Chapter 2. For more information about mknod, see the section "Creating Device Files With mknod" in Chapter 2.

The following examples of output are the results of the ls -l command invoked on a user's regular file and on the /dev directory. They show the difference in structure between regular and device files. This is a regular file:

-rw-r----- 1 ralph raccoons 1050 Apr 23 08:14 scheme.notes 
Regular files are indicated by a dash (-) in the first column. The remainder of the output is explained in the guide IRIX Admin: System Configuration and Operation.

These are device files:

brw------- 2 root sys 128,16 Apr 15 10:59 /dev/dsk/dks0d1s1 
brw------- 2 root sys 128,16 Apr 15 10:59 /dev/root 
brw------- 2 root sys 128,22 Apr 12 13:51 /dev/dsk/dks0d1s6 
brw------- 2 root sys 128,22 Apr 12 13:51 /dev/usr 
crw------- 2 root sys 128,16 Apr 15 10:58 /dev/rdsk/dks0d1s0 
crw------- 2 root sys 128,16 Apr 15 10:58 /dev/rroot 
crw------- 2 root sys 128,22 Apr 12 13:51 /dev/rdsk/dks0d1s6 
crw------- 2 root sys 128,22 Apr 12 13:51 /dev/rusr 
The device file listing has some similar information to the listing of the regular file, but also contains additional information. The device files shown have the following characteristics:

The following sections explain each of these characteristics of device files.


Block and Character Devices
Device Permissions and Owner
Major and Minor Devices
Device Names

Next | Prev | Up | Top | Contents | Index